Compute the area of rectangle and triangle